package io.sage.modules.goods.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.sage.modules.goods.entity.BGoods;
import io.sage.modules.goods.enums.GoodsRecordStatusEnum;
import io.sage.modules.goods.enums.GoodsRecordTypeStatusEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 物品检查记录表(BGoodsRecord)实体类
 *
 * @author zxh
 * @since 2019-08-05 11:25:19
 */
public class BGoodsRecord implements Serializable {
    private static final long serialVersionUID = -53233549650821592L;
    //主键id
    private Integer id;
    //物品id
    private Integer goodsId;
    //状态 0 未损害 1 损坏
    private Integer status;
    //状态 0 未损害 1 损坏
    private String statusName;
    //用户id 后台管理员
    private Long userId;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date createTime;
    //损坏原因id 预留
    private Integer damage;
    //图片地址
    private String pic;
    //备注
    private String remark;
    //是否删除，1删除，0未删除
    private Integer isDel;
    //检测类型 1常规检查 2定时检查
    private Integer type;

    private String typeName;

    private BGoods bGoods;



    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getDamage() {
        return damage;
    }

    public void setDamage(Integer damage) {
        this.damage = damage;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusName() {
        if(this.status==null){
            return "";
        }
        String name= GoodsRecordStatusEnum.getMessage(this.status);
        return name;
    }

    public void setStatusName(String statusName) {
        this.statusName = GoodsRecordStatusEnum.getMessage(this.status);
    }

    public BGoods getbGoods() {
        return bGoods;
    }

    public void setbGoods(BGoods bGoods) {
        this.bGoods = bGoods;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = GoodsRecordTypeStatusEnum.getMessage(this.type);
    }
}